
package com.yuan.hibernate;

import org.hibernate.LockMode;
import org.hibernate.Query;
import org.hibernate.criterion.Example;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

/**
 * A data access object (DAO) providing persistence and search support for 员工信息表
 * entities. Transaction control of the save(), update() and delete() operations
 * can directly support Spring container-managed transactions or they can be
 * augmented to handle user-managed Spring transactions. Each of these methods
 * provides additional information for how to configure it for the desired type
 * of transaction control.
 * 
 * @see com.yuan.hibernate.员工信息表
 * @author MyEclipse Persistence Tools
 */
@SuppressWarnings("rawtypes")
public class 员工信息表DAO extends BaseHibernateDAO {
    private static final Logger log = LoggerFactory.getLogger(员工信息表DAO.class);
    // property constants
    public static final String _姓名 = "姓名";
    public static final String _性别 = "性别";
    public static final String _民族 = "民族";
    public static final String _政治面貌 = "政治面貌";
    public static final String _身份证号码 = "身份证号码";
    public static final String _工种岗位 = "工种岗位";
    public static final String _技能鉴定工种 = "技能鉴定工种";
    public static final String _职称 = "职称";
    public static final String _工资表职称 = "工资表职称";
    public static final String _取证日期 = "取证日期";
    public static final String _用工性质 = "用工性质";
    public static final String _学历 = "学历";
    public static final String _毕业时间 = "毕业时间";
    public static final String _所学专业 = "所学专业";
    public static final String _学历类型 = "学历类型";
    public static final String _毕业院校 = "毕业院校";
    public static final String _籍贯 = "籍贯";
    public static final String _所属队室 = "所属队室";
    public static final String _目前岗位 = "目前岗位";
    public static final String _住址 = "住址";
    public static final String _血型 = "血型";
    public static final String _婚姻状况 = "婚姻状况";
    public static final String _档案编号 = "档案编号";
    public static final String _社会保险号 = "社会保险号";
    public static final String _合同编号 = "合同编号";
    public static final String _企业编号 = "企业编号";
    public static final String _备注 = "备注";
    public static final String _学习简历 = "学习简历";
    public static final String _工作简历 = "工作简历";
    public static final String _家庭成员 = "家庭成员";
    public static final String _照片 = "照片";
    public static final String _电话 = "电话";

    public void save(员工信息表 transientInstance) {
        log.debug("saving 员工信息表 instance");
        try {
            getSession().save(transientInstance);
            log.debug("save successful");
        } catch (RuntimeException re) {
            log.error("save failed", re);
            throw re;
        }
    }

    public void update(员工信息表 transientInstance) {
        log.debug("update 员工信息表 instance");
        try {
            getSession().update(transientInstance);
            log.debug("update successful");
        } catch (RuntimeException re) {
            log.error("update failed", re);
            throw re;
        }
    }

    public void delete(员工信息表 persistentInstance) {
        log.debug("deleting 员工信息表 instance");
        try {
            getSession().delete(persistentInstance);
            log.debug("delete successful");
        } catch (RuntimeException re) {
            log.error("delete failed", re);
            throw re;
        }
    }

    public 员工信息表 findById(java.lang.Integer id) {
        log.debug("getting 员工信息表 instance with id: " + id);
        try {
            员工信息表 instance = (员工信息表) getSession()
                    .get("com.yuan.hibernate.员工信息表", id);
            return instance;
        } catch (RuntimeException re) {
            log.error("get failed", re);
            throw re;
        }
    }

    public List findByExample(员工信息表 instance) {
        log.debug("finding 员工信息表 instance by example");
        try {
            List results = getSession()
                    .createCriteria("com.yuan.hibernate.员工信息表")
                    .add(Example.create(instance))
                    .list();
            log.debug("find by example successful, result size: " + results.size());
            return results;
        } catch (RuntimeException re) {
            log.error("find by example failed", re);
            throw re;
        }
    }

    public List findByProperty(String propertyName, Object value) {
        log.debug("finding 员工信息表 instance with property: " + propertyName
                + ", value: " + value);
        try {
            String queryString = "from 员工信息表 as model where model."
                    + propertyName + "= ?";
            Query queryObject = getSession().createQuery(queryString);
            queryObject.setParameter(0, value);
            return queryObject.list();
        } catch (RuntimeException re) {
            log.error("find by property name failed", re);
            throw re;
        }
    }

    public List findBy姓名(Object 姓名
            ) {
        return findByProperty(_姓名, 姓名);
    }

    public List findBy性别(Object 性别
            ) {
        return findByProperty(_性别, 性别);
    }

    public List findBy民族(Object 民族
            ) {
        return findByProperty(_民族, 民族);
    }

    public List findBy政治面貌(Object 政治面貌
            ) {
        return findByProperty(_政治面貌, 政治面貌);
    }

    public List findBy身份证号码(Object 身份证号码
            ) {
        return findByProperty(_身份证号码, 身份证号码);
    }

    public List findBy工种岗位(Object 工种岗位
            ) {
        return findByProperty(_工种岗位, 工种岗位);
    }

    public List findBy技能鉴定工种(Object 技能鉴定工种
            ) {
        return findByProperty(_技能鉴定工种, 技能鉴定工种);
    }

    public List findBy职称(Object 职称
            ) {
        return findByProperty(_职称, 职称);
    }

    public List findBy工资表职称(Object 工资表职称
            ) {
        return findByProperty(_工资表职称, 工资表职称);
    }

    public List findBy取证日期(Object 取证日期
            ) {
        return findByProperty(_取证日期, 取证日期);
    }

    public List findBy用工性质(Object 用工性质
            ) {
        return findByProperty(_用工性质, 用工性质);
    }

    public List findBy学历(Object 学历
            ) {
        return findByProperty(_学历, 学历);
    }

    public List findBy毕业时间(Object 毕业时间
            ) {
        return findByProperty(_毕业时间, 毕业时间);
    }

    public List findBy所学专业(Object 所学专业
            ) {
        return findByProperty(_所学专业, 所学专业);
    }

    public List findBy学历类型(Object 学历类型
            ) {
        return findByProperty(_学历类型, 学历类型);
    }

    public List findBy毕业院校(Object 毕业院校
            ) {
        return findByProperty(_毕业院校, 毕业院校);
    }

    public List findBy籍贯(Object 籍贯
            ) {
        return findByProperty(_籍贯, 籍贯);
    }

    public List findBy所属队室(Object 所属队室
            ) {
        return findByProperty(_所属队室, 所属队室);
    }

    public List findBy目前岗位(Object 目前岗位
            ) {
        return findByProperty(_目前岗位, 目前岗位);
    }

    public List findBy住址(Object 住址
            ) {
        return findByProperty(_住址, 住址);
    }

    public List findBy血型(Object 血型
            ) {
        return findByProperty(_血型, 血型);
    }

    public List findBy婚姻状况(Object 婚姻状况
            ) {
        return findByProperty(_婚姻状况, 婚姻状况);
    }

    public List findBy档案编号(Object 档案编号
            ) {
        return findByProperty(_档案编号, 档案编号);
    }

    public List findBy社会保险号(Object 社会保险号
            ) {
        return findByProperty(_社会保险号, 社会保险号);
    }

    public List findBy合同编号(Object 合同编号
            ) {
        return findByProperty(_合同编号, 合同编号);
    }

    public List findBy企业编号(Object 企业编号
            ) {
        return findByProperty(_企业编号, 企业编号);
    }

    public List findBy备注(Object 备注
            ) {
        return findByProperty(_备注, 备注);
    }

    public List findBy学习简历(Object 学习简历
            ) {
        return findByProperty(_学习简历, 学习简历);
    }

    public List findBy工作简历(Object 工作简历
            ) {
        return findByProperty(_工作简历, 工作简历);
    }

    public List findBy家庭成员(Object 家庭成员
            ) {
        return findByProperty(_家庭成员, 家庭成员);
    }

    public List findBy照片(Object 照片
            ) {
        return findByProperty(_照片, 照片);
    }

    public List findBy电话(Object 电话
            ) {
        return findByProperty(_电话, 电话);
    }

    public List findAll() {
        log.debug("finding all 员工信息表 instances");
        try {
            String queryString = "from 员工信息表";
            Query queryObject = getSession().createQuery(queryString);
            return queryObject.list();
        } catch (RuntimeException re) {
            log.error("find all failed", re);
            throw re;
        }
    }

    public 员工信息表 merge(员工信息表 detachedInstance) {
        log.debug("merging 员工信息表 instance");
        try {
            员工信息表 result = (员工信息表) getSession()
                    .merge(detachedInstance);
            log.debug("merge successful");
            return result;
        } catch (RuntimeException re) {
            log.error("merge failed", re);
            throw re;
        }
    }

    public void attachDirty(员工信息表 instance) {
        log.debug("attaching dirty 员工信息表 instance");
        try {
            getSession().saveOrUpdate(instance);
            log.debug("attach successful");
        } catch (RuntimeException re) {
            log.error("attach failed", re);
            throw re;
        }
    }

    public void attachClean(员工信息表 instance) {
        log.debug("attaching clean 员工信息表 instance");
        try {
            getSession().lock(instance, LockMode.NONE);
            log.debug("attach successful");
        } catch (RuntimeException re) {
            log.error("attach failed", re);
            throw re;
        }
    }
}
